<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkTreeSortable</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="prev" href="GtkIconView.html" title="GtkIconView">
<link rel="next" href="GtkTreeModelSort.html" title="GtkTreeModelSort">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
<link rel="chapter" href="ch02.html" title="Widget Gallery">
<link rel="chapter" href="WindowWidgets.html" title="Windows">
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
<link rel="chapter" href="Ornaments.html" title="Ornaments">
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
<link rel="chapter" href="Printing.html" title="Printing">
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
<link rel="chapter" href="Builder.html" title="Interface builder">
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry">
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
<link rel="chapter" href="gtk-migrating-GtkBuilder.html" title="Migrating from libglade to GtkBuilder">
<link rel="chapter" href="gtk-migrating-tooltips.html" title="Migrating from GtkTooltips to GtkTooltip">
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
<link rel="glossary" href="glossary.html" title="Glossary">
<link rel="index" href="api-index-full.html" title="Index of all symbols">
<link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
<link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
<link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
<link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
<link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
<link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
<link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
<link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GtkIconView.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ Reference Manual</th>
<td><a accesskey="n" href="GtkTreeModelSort.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GtkTreeSortable.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#GtkTreeSortable.description" class="shortcut">Description</a>
                 | 
                <a href="#GtkTreeSortable.object-hierarchy" class="shortcut">Object Hierarchy</a>
                 | 
                <a href="#GtkTreeSortable.prerequisites" class="shortcut">Prerequisites</a>
                 | 
                <a href="#GtkTreeSortable.implementations" class="shortcut">Known Implementations</a>
                 | 
                <a href="#GtkTreeSortable.signals" class="shortcut">Signals</a>
</td></tr>
</table>
<div class="refentry" lang="en">
<a name="GtkTreeSortable"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkTreeSortable.top_of_page"></a>GtkTreeSortable</span></h2>
<p>GtkTreeSortable — The interface for sortable models used by GtkTreeView</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GtkTreeSortable.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;gtk/gtk.h&gt;

                    <a class="link" href="GtkTreeSortable.html#GtkTreeSortable-struct" title="GtkTreeSortable">GtkTreeSortable</a>;
                    <a class="link" href="GtkTreeSortable.html#GtkTreeSortableIface" title="GtkTreeSortableIface">GtkTreeSortableIface</a>;
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                (<a class="link" href="GtkTreeSortable.html#GtkTreeIterCompareFunc" title="GtkTreeIterCompareFunc ()">*GtkTreeIterCompareFunc</a>)           (<a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *model,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreeIter" title="GtkTreeIter">GtkTreeIter</a> *a,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreeIter" title="GtkTreeIter">GtkTreeIter</a> *b,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
void                <a class="link" href="GtkTreeSortable.html#gtk-tree-sortable-sort-column-changed" title="gtk_tree_sortable_sort_column_changed ()">gtk_tree_sortable_sort_column_changed</a>
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GtkTreeSortable.html#gtk-tree-sortable-get-sort-column-id" title="gtk_tree_sortable_get_sort_column_id ()">gtk_tree_sortable_get_sort_column_id</a>
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> *sort_column_id,
                                                         <a class="link" href="gtk-Standard-Enumerations.html#GtkSortType" title="enum GtkSortType">GtkSortType</a> *order);
void                <a class="link" href="GtkTreeSortable.html#gtk-tree-sortable-set-sort-column-id" title="gtk_tree_sortable_set_sort_column_id ()">gtk_tree_sortable_set_sort_column_id</a>
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> sort_column_id,
                                                         <a class="link" href="gtk-Standard-Enumerations.html#GtkSortType" title="enum GtkSortType">GtkSortType</a> order);
void                <a class="link" href="GtkTreeSortable.html#gtk-tree-sortable-set-sort-func" title="gtk_tree_sortable_set_sort_func ()">gtk_tree_sortable_set_sort_func</a>     (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> sort_column_id,
                                                         <a class="link" href="GtkTreeSortable.html#GtkTreeIterCompareFunc" title="GtkTreeIterCompareFunc ()">GtkTreeIterCompareFunc</a> sort_func,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);
void                <a class="link" href="GtkTreeSortable.html#gtk-tree-sortable-set-default-sort-func" title="gtk_tree_sortable_set_default_sort_func ()">gtk_tree_sortable_set_default_sort_func</a>
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a class="link" href="GtkTreeSortable.html#GtkTreeIterCompareFunc" title="GtkTreeIterCompareFunc ()">GtkTreeIterCompareFunc</a> sort_func,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="GtkTreeSortable.html#gtk-tree-sortable-has-default-sort-func" title="gtk_tree_sortable_has_default_sort_func ()">gtk_tree_sortable_has_default_sort_func</a>
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GInterface
   +----GtkTreeSortable
</pre>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.prerequisites"></a><h2>Prerequisites</h2>
<p>
GtkTreeSortable requires
 <a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> and  <a
href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>.</p>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.implementations"></a><h2>Known Implementations</h2>
<p>
GtkTreeSortable is implemented by
 <a class="link" href="GtkTreeModelSort.html" title="GtkTreeModelSort">GtkTreeModelSort</a>,  <a class="link" href="GtkTreeStore.html" title="GtkTreeStore">GtkTreeStore</a> and  <a class="link" href="GtkListStore.html" title="GtkListStore">GtkListStore</a>.</p>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.signals"></a><h2>Signals</h2>
<pre class="synopsis">
  "<a class="link" href="GtkTreeSortable.html#GtkTreeSortable-sort-column-changed" title='The "sort-column-changed" signal'>sort-column-changed</a>"                            : Run Last
</pre>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.description"></a><h2>Description</h2>
<p>
<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a> is an interface to be implemented by tree models which
support sorting. The <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> uses the methods provided by this interface
to sort the model.
</p>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="GtkTreeSortable-struct"></a><h3>GtkTreeSortable</h3>
<pre class="programlisting">typedef struct _GtkTreeSortable GtkTreeSortable;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GtkTreeSortableIface"></a><h3>GtkTreeSortableIface</h3>
<pre class="programlisting">typedef struct {
  GTypeInterface g_iface;

  /* signals */
  void     (* sort_column_changed)   (GtkTreeSortable        *sortable);

  /* virtual table */
  gboolean (* get_sort_column_id)    (GtkTreeSortable        *sortable,
				      gint                   *sort_column_id,
				      GtkSortType            *order);
  void     (* set_sort_column_id)    (GtkTreeSortable        *sortable,
				      gint                    sort_column_id,
				      GtkSortType             order);
  void     (* set_sort_func)         (GtkTreeSortable        *sortable,
				      gint                    sort_column_id,
				      GtkTreeIterCompareFunc  func,
				      gpointer                data,
				      GDestroyNotify          destroy);
  void     (* set_default_sort_func) (GtkTreeSortable        *sortable,
				      GtkTreeIterCompareFunc  func,
				      gpointer                data,
				      GDestroyNotify          destroy);
  gboolean (* has_default_sort_func) (GtkTreeSortable        *sortable);
} GtkTreeSortableIface;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="GtkTreeIterCompareFunc"></a><h3>GtkTreeIterCompareFunc ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                (*GtkTreeIterCompareFunc)           (<a class="link" href="GtkTreeModel.html" title="GtkTreeModel">GtkTreeModel</a> *model,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreeIter" title="GtkTreeIter">GtkTreeIter</a> *a,
                                                         <a class="link" href="GtkTreeModel.html#GtkTreeIter" title="GtkTreeIter">GtkTreeIter</a> *b,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive
integer if <em class="parameter"><code>a</code></em> sorts before <em class="parameter"><code>b</code></em>, <em class="parameter"><code>a</code></em> sorts with <em class="parameter"><code>b</code></em>, or <em class="parameter"><code>a</code></em> sorts after <em class="parameter"><code>b</code></em>
respectively. If two iters compare as equal, their order in the sorted model
is undefined. In order to ensure that the <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a> behaves as
expected, the GtkTreeIterCompareFunc must define a partial order on
the model, i.e. it must be reflexive, antisymmetric and transitive.
</p>
<p>
For example, if <em class="parameter"><code>model</code></em> is a product catalogue, then a compare function
for the "price" column could be one which returns
<code class="literal">price_of(<em class="parameter"><code>a</code></em>) - price_of(<em class="parameter"><code>b</code></em>)</code>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>model</code></em> :</span></p></td>
<td>The <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> the comparison is within
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
<td>A <a class="link" href="GtkTreeModel.html#GtkTreeIter" title="GtkTreeIter"><span class="type">GtkTreeIter</span></a> in <em class="parameter"><code>model</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
<td>Another <a class="link" href="GtkTreeModel.html#GtkTreeIter" title="GtkTreeIter"><span class="type">GtkTreeIter</span></a> in <em class="parameter"><code>model</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>Data passed when the compare func is assigned e.g. by
<a class="link" href="GtkTreeSortable.html#gtk-tree-sortable-set-sort-func" title="gtk_tree_sortable_set_sort_func ()"><code class="function">gtk_tree_sortable_set_sort_func()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-sortable-sort-column-changed"></a><h3>gtk_tree_sortable_sort_column_changed ()</h3>
<pre class="programlisting">void                gtk_tree_sortable_sort_column_changed
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable);</pre>
<p>
Emits a GtkTreeSortable::sort_column_changed signal on</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>sortable</code></em> :</span></p></td>
<td> A <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-sortable-get-sort-column-id"></a><h3>gtk_tree_sortable_get_sort_column_id ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_sortable_get_sort_column_id
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> *sort_column_id,
                                                         <a class="link" href="gtk-Standard-Enumerations.html#GtkSortType" title="enum GtkSortType">GtkSortType</a> *order);</pre>
<p>
Fills in <em class="parameter"><code>sort_column_id</code></em> and <em class="parameter"><code>order</code></em> with the current sort column and the
order.  It returns <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> unless the <em class="parameter"><code>sort_column_id</code></em> is 
<code class="literal">GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</code> or 
<code class="literal">GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</code>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sortable</code></em> :</span></p></td>
<td> A <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sort_column_id</code></em> :</span></p></td>
<td> The sort column id to be filled in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
<td> The <a class="link" href="gtk-Standard-Enumerations.html#GtkSortType" title="enum GtkSortType"><span class="type">GtkSortType</span></a> to be filled in
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the sort column is not one of the special sort
  column ids.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-sortable-set-sort-column-id"></a><h3>gtk_tree_sortable_set_sort_column_id ()</h3>
<pre class="programlisting">void                gtk_tree_sortable_set_sort_column_id
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> sort_column_id,
                                                         <a class="link" href="gtk-Standard-Enumerations.html#GtkSortType" title="enum GtkSortType">GtkSortType</a> order);</pre>
<p>
Sets the current sort column to be <em class="parameter"><code>sort_column_id</code></em>.  The <em class="parameter"><code>sortable</code></em> will
resort itself to reflect this change, after emitting a
GtkTreeSortable::sort_column_changed signal.  If <em class="parameter"><code>sort_column_id</code></em> is
<code class="literal">GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</code>, then the default sort function
will be used, if it is set.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sortable</code></em> :</span></p></td>
<td> A <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sort_column_id</code></em> :</span></p></td>
<td> the sort column id to set
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>order</code></em> :</span></p></td>
<td> The sort order of the column
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-sortable-set-sort-func"></a><h3>gtk_tree_sortable_set_sort_func ()</h3>
<pre class="programlisting">void                gtk_tree_sortable_set_sort_func     (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> sort_column_id,
                                                         <a class="link" href="GtkTreeSortable.html#GtkTreeIterCompareFunc" title="GtkTreeIterCompareFunc ()">GtkTreeIterCompareFunc</a> sort_func,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);</pre>
<p>
Sets the comparison function used when sorting to be <em class="parameter"><code>sort_func</code></em>.  If the
current sort column id of <em class="parameter"><code>sortable</code></em> is the same as <em class="parameter"><code>sort_column_id</code></em>, then the
model will sort using this function.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sortable</code></em> :</span></p></td>
<td> A <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sort_column_id</code></em> :</span></p></td>
<td> the sort column id to set the function for
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sort_func</code></em> :</span></p></td>
<td> The comparison function
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> User data to pass to <em class="parameter"><code>sort_func</code></em>, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td> Destroy notifier of <em class="parameter"><code>user_data</code></em>, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-sortable-set-default-sort-func"></a><h3>gtk_tree_sortable_set_default_sort_func ()</h3>
<pre class="programlisting">void                gtk_tree_sortable_set_default_sort_func
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable,
                                                         <a class="link" href="GtkTreeSortable.html#GtkTreeIterCompareFunc" title="GtkTreeIterCompareFunc ()">GtkTreeIterCompareFunc</a> sort_func,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"
>GDestroyNotify</a> destroy);</pre>
<p>
Sets the default comparison function used when sorting to be <em class="parameter"><code>sort_func</code></em>.  
If the current sort column id of <em class="parameter"><code>sortable</code></em> is
<code class="literal">GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</code>, then the model will sort using 
this function.
</p>
<p>
If <em class="parameter"><code>sort_func</code></em> is <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>, then there will be no default comparison function.
This means that once the model  has been sorted, it can't go back to the
default state. In this case, when the current sort column id of <em class="parameter"><code>sortable</code></em> is
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sortable</code></em> :</span></p></td>
<td> A <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sort_func</code></em> :</span></p></td>
<td> The comparison function
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> User data to pass to <em class="parameter"><code>sort_func</code></em>, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td> Destroy notifier of <em class="parameter"><code>user_data</code></em>, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="gtk-tree-sortable-has-default-sort-func"></a><h3>gtk_tree_sortable_has_default_sort_func ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            gtk_tree_sortable_has_default_sort_func
                                                        (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *sortable);</pre>
<p>
Returns <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if the model has a default sort function.  This is used
primarily by GtkTreeViewColumns in order to determine if a model can go back
to the default state, or not.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sortable</code></em> :</span></p></td>
<td> A <a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a>, if the model has a default sort function
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2" lang="en">
<a name="GtkTreeSortable-sort-column-changed"></a><h3>The <code class="literal">"sort-column-changed"</code> signal</h3>
<pre class="programlisting">void                user_function                      (<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable">GtkTreeSortable</a> *treesortable,
                                                        <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a>         user_data)         : Run Last</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>treesortable</code></em> :</span></p></td>
<td>the object which received the signal.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data set when the signal handler was connected.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="GtkTreeSortable.see-also"></a><h2>See Also</h2>
<p>
<a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>, <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>
